package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.FpVideoDTO;
import com.financing.wap.dao.IFpVideoDao;
import com.financing.wap.common.SqlName;
/**
 * fp_video  
 * 路演视频 数据访问层实现类
 * @author lisu
 *
 */
 
@Repository("fpVideoDao")
public class FpVideoDaoImpl extends BaseDaoImpl<FpVideoDTO, java.lang.Integer> implements IFpVideoDao {


	@Override
	public int insert(FpVideoDTO fpVideo) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.FpVideoSql.insert, fpVideo);
	}

	@Override
	public void update(FpVideoDTO fpVideo) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpVideoSql.update, fpVideo);
	}

	@Override
	public void updateForce(FpVideoDTO fpVideo) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpVideoSql.updateForce, fpVideo);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.FpVideoSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpVideoDTO> queryList(FpVideoDTO fpVideo) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.FpVideoSql.queryList, fpVideo);
	}

	@Override
	public int queryListCount(FpVideoDTO fpVideo) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.FpVideoSql.queryListCount, fpVideo);
	}

	@Override
	public FpVideoDTO loadById(Integer id) throws SQLException {
		return  (FpVideoDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.FpVideoSql.loadById,id);
	}

	@Override
	public Class<FpVideoDTO> getEntityClass() {
		return FpVideoDTO.class;
	}

	@Override
	public FpVideoDTO queryVideoInfo(FpVideoDTO fpVideo) throws SQLException {
		return (FpVideoDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.FpVideoSql.queryVideoInfo,fpVideo);
	}
 	
}
